/*
============================================================================
 Name        : dd_zip.h
 Author      : Jian
 Version     :
 Copyright   : GPL
 Description : dd_zip.h - header file
============================================================================
*/

#ifndef DD_ZIP_H
#define DD_ZIP_H

/* INCLUDES */
#include "dd_define.h"
#include "zlib.h"

__DD_BEGIN_DECLS

/* just a simple enclosure for zlib */

struct z_stream_s ;
typedef struct __dd_zip dd_zip ;

struct __dd_zip {
    struct z_stream_s zlibStream ;
};

dd_zip* dd_zip_create() ;

void dd_zip_destroy(dd_zip* zip) ;

int dd_zip_reset(dd_zip* zip) ;

/*
*  srcLen:  IN is the original data size,  OUT is the not handled length of src 
*  destLen: IN is the length of dest buffer, OUT is the unzip data length
*/
int dd_zip_ungzip(dd_zip* zip, const char* src, int* srcLen, char* dest, int* destLen) ;

__DD_END_DECLS 

#endif  /* DD_ZIP_H */

/* End of File */
